package org.z23.agentwork.controller;

import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import org.z23.agentwork.info.Logic;
import org.z23.agentwork.service.AgentService;
import org.z23.agentwork.service.ChatService;

@RestController
@RequestMapping("/api/agent")
public class AgentController {

    @Resource
    private AgentService agentService;
    @Resource
    private ChatService chatModel;

    /*
    @GetMapping("/{cityName}")
    public String getWeather(@PathVariable String cityName) {
        return agentService.getWeatherInfo(cityName);
    }

    @GetMapping("getDressingAdvice/{input}")
    public String getDressingAdvice(@PathVariable String input) {
        System.out.println("开始获取MCP工具");
        return agentService.getDressingAdvice(input);
    }

     */

    //开始进入工作流
    @GetMapping("work")
    public String work(@RequestParam(value = "message", defaultValue = "杭州明天穿什么?") String message,
                       @RequestParam(value = "logic", defaultValue = "AND") Logic logic){
        return agentService.begin(message,logic);
    }


    @GetMapping("chat")
    public String generate(@RequestParam(value = "message", defaultValue = "hello")
                           String message) {
        return chatModel.chat(message);
    }

}
